-LRB- CNN -RRB- -- Republican Joni Ernst has won the race for Iowa 's U.S. Senate seat held by retiring Democratic Sen. Tom Harkin , defeating Democratic challenger Bruce Braley , according to a CNN projection .

The win in the Hawkeye State , which voted for President Barack Obama twice , joins a list of Republican pickups that have swept the party into the Senate majority .

National Democrats were initially confident they would hold the seat but Ernst surprised them with a determined and effective campaign . The importance of the seat was evident by the millions of dollars outside groups poured into advertising , making it one of the most expensive races of the cycle .

The polls were neck and neck through much of the campaign with Ernst appearing to get a small lead over Braley recently .

Ernst was a little-known Iowa state senator when she burst on the national political scene during the GOP primary , declaring in a TV ad that if elected she would cut pork spending in Washington the way she castrated pigs growing up on an Iowa farm . Conservatives were thrilled .

`` Washington is full of big spending , '' she said smiling into the camera . `` Let 's make 'em squeal . ''

The ad set the tone for Ernst 's energetic and appealing campaign . It helped her get past some voters ' concerns that as a tea party favorite she was too conservative to take the seat held for five terms by progressive Democratic stalwart Sen. Tom Harkin .

The popular Harkin campaigned for Braley but could n't make up for several gaffes and missteps the four-term lawmaker made during the campaign that surprised and disappointed his supporters in Iowa and Washington .

At one point , he appeared to belittle both Iowa farmers and the state 's senior senator , Republican Chuck Grassley . He described Grassley , who is in line to chair the Judiciary Committee if the GOP takes over the Senate , `` as a farmer from Iowa who never went to law school . ''

Braley was also criticized when it was revealed his family had filed a complaint against a neighbor whose chickens were crossing onto his property .

Ernst raised the issue at a recent debate .

`` You elect to sue a neighbor over chickens that came onto your property . You 're talking about bipartisanship , how do we expect , as Iowans , that you will work across the aisle when you ca n't walk across your yard ? '' she said .

At the same debate , Braley argued Ernst would side with the far right wing of the GOP Congress .

`` I 'm a bridge builder not a bridge burner , '' Braley said . `` Sen. Ernst would have voted to shut down the federal government . She 's called President Obama a dictator and thinks impeachment should be on the table ''

@highlight

Republican Joni Ernst defeated Democrat Bruce Braley in Iowa 's Senate race

@highlight

The win gives Republicans another win in a state President Obama carried in 2012

@highlight

Ernst takes the seat being vacated by retiring Democratic Sen. Tom Harkin